<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        /**
 * @param {string[]} strs
 * @return {number}
 */
        var minDeletionSize = function (strs) {
            let result = 0, m = strs.length, n = strs[0].length;
            for (let i = 0; i < n; i++) {
                for (let j = 1; j < m; j++) {
                    if (strs[j][i].charCodeAt() < strs[j - 1][i].charCodeAt()) {
                        result++;
                        break;
                    }
                }
            }
            return result;
        };
        console.log(minDeletionSize(["cba", "daf", "ghi"]));
    </script>
</body>

</html>